﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

namespace DNA.Mvc.Installation
{
    public static class InstallationHelpers
    {
        public static int WidgetsSeed(this IDataContext dbContext)
        {
            var _tmpls = dbContext.WidgetTemplates.All();
            foreach (var _tmpl in _tmpls)
                dbContext.WidgetDescriptors.Create(_tmpl, _tmpl.ID);
            return dbContext.SaveChanges();
        }
    }
}
